//
//  XYSDKManager.h
//  NemoSDKDemo
//
//  Created by 高超 on 2020/7/30.
//  Copyright © 2020 JackYang. All rights reserved.
//
//
//    XYSDKManager类位于上层ui业务与sdk之间，上层调用SDK方法均由此类转发，并记录一些状态值；
//    您在集成SDK时，可以直接使用此类提供的基本方法


#import <Foundation/Foundation.h>

@interface XYSDKManager : NSObject

/// 当前用户信息
@property (nonatomic, strong) XYUser *user;

/// 是否正在录制中
@property (nonatomic, assign) BOOL isRecording;

/// 录制地址
@property (nonatomic, strong) NSString *recordingUrl;

/// 当前会议号
@property (nonatomic, strong) NSString *meetingNumber;

/// 默认前置摄像头
@property (nonatomic, assign) NSInteger isDefaultFrontCamera;

/// 是否本地麦克风静音
@property (nonatomic, assign) BOOL muteAudio;

/// 是否关闭本地视频
@property (nonatomic, assign) BOOL muteVideo;

/// 当前视频方向
@property (nonatomic, assign) NemoVideoOrientation orientation;

/// 全局单例
+ (XYSDKManager *)sharedInstance;

/// 创建SDK实例对象，初始化，设置默认参数
- (void)create:(NSString *)account password:(NSString *)password;;

/// 加入会议
/// @param number 会议号
/// @param password 密码
- (void)joinMeeting:(NSString *)number password:(NSString *)password;

/// 创建视频
/// @param videoCanvas 画布类，绑定view和layout
- (void)setupVideo:(XYRTCVideoCanvas *)videoCanvas;

/// 更新视频
/// @param videoCanvas 画布类，绑定view和layout
- (void)updateVideo:(XYRTCVideoCanvas *)videoCanvas;

/// 请求视频流
/// @param layoutPolicys 需要请流的信息
- (void)setLayoutPolicy:(NemoCustomLayoutInfo *)layoutPolicys;

/// 离开会议
- (void)leaveMeeting;

/// 接受会议邀请
- (void)acceptMeeting;

/// 拒绝会议邀请
- (void)rejectMeeting;

/// 来电是否已被其他终端响应 (同一账号在不同平台登录时，需要判断状态)
- (BOOL)isComingCallDispose;

/// DTFT
/// @param fullScreenLayout 大窗口视频流
/// @param content 发送内容
- (void)dialDtmfWithfullScreenLayout:(NemoLayout *)fullScreenLayout content:(NSString *)content;

/// 手电筒开关
/// @param mode 状态
- (void)switchTorchMode:(NemoTorchMode)mode;

/// 当前手电筒状态
- (NemoTorchMode)torchMode;

/// 手电筒等级
/// @param level 等级
- (void)torchLevel:(float)level;

/// 开始录制
- (void)startRecording;

/// 停止录制
- (void)stopRecording;

/// 检查录制权限
/// @param handler 回调
- (void)checkPermissionWithCompletion:(void (^)(BOOL isRecordable, NSString *recordingUrl, NSString *errorInfo))handler;

/// 检查录制空间
/// @param handler 回调
- (void)checkSorageWithCompletion:(void (^)(BOOL isStorage, NSString *errorInfo))handler;

/// 会控地址
- (NSString *)getMeetingControlUrl;

/// 本地麦克风
/// @param mute 是否静音
- (void)setLocalMicMute:(BOOL)mute;

/// 本地扬声器（只有第一次入会或者发送音频中断后恢复时调用，其他时间不调用）
/// @param on 是否打开
- (void)setSpeakerphoneOn:(BOOL)on;

/// 本地麦克风是否静音
- (BOOL)isLocalMicMuted;

/// 本地视频
/// @param mute 是否关闭
- (void)setLocalVideoMute:(BOOL)mute;

/// 本地视频是否关闭
- (BOOL)isLocalVideoMuted;

/// 举手发言
- (void)handsUp;

/// 取消举手
- (void)handsDown;

/// 结束发言
- (void)endSpeech;

/// 语音模式
/// @param enable 是否开启
- (void)enableAudioMode:(BOOL)enable;

/// 切换摄像头
/// @param type 方向
- (void)switchCamera:(NemoDeviceType)type;

/// 开始分享content
/// @param type 类型
- (void)startContentSharing:(NemoShareContentType)type;

/// 发送content数据
/// @param content 数据内容
- (void)sendContentMsg:(XYRTCContent *)content;

/// 停止分享content
- (void)stopContentSharing;

/// 切换视频方向
/// @param orientation 方向
- (void)changeOrientation:(NemoVideoOrientation)orientation;

/// 开启白板
- (void)startWhiteboard;

/// 关闭白板
- (void)stopWhiteboard;

/// 发送白板数据
/// @param message 内容
/// @param type 动作
- (void)sendWhiteboardMsg:(id)message type:(NemoWhiteboardOperationState)type;

/// 修改用户名称
/// @param displayName 新用户名
/// @param completion 回调
- (void)modifyDisplayName:(NSString *)displayName completion:(void (^)(BOOL success))completion;

/// 上传日志
/// @param comments 内容
- (void)sendFeedbackLogWithComments:(NSString *)comments;

/// FECC
/// @param operation 动作
/// @param participantId 远端participantId
- (void)farEndHardwareControlOperation:(XYFECCOperation)operation participantId:(NSString *)participantId;

/// SDK版本号
- (NSString *)sdkVersion;

/// 统计信息
- (NSString *)getGeneralStatistics;

/// DBA信息
- (NSString *)getDBStatistics;

/// 视频发送信息
- (NSString *)getVideoTxStatistics;

/// 视频接收信息
- (NSString *)getVideoRxStatistics;

/// 音频发送信息
- (NSString *)getAudioTxStatistics;

/// 音频接收信息
- (NSString *)getAudioRxStatistics;

/// 其他信息
- (NSString *)getOtherStatistics;

/// layout信息
- (NSString *)getLayoutStatistics;

@end
